package com.fit.pages;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.fit.interfaces.Car;
import com.fit.interfaces.Reservation;
import com.fit.interfaces.User;
import com.fit.service.Reservations;

public class ViewReservation {

	@SessionState
	private User user;
	
	private boolean userExists;
	
	Object onActivate(){
		if(!userExists) return Login.class;
		return null;
	}
	
	public User getUser(){
		return user;
	}
	
//	public Car getFirstCar(){
//		//return currentBorrow.getCar().get(0);
//		//return currentReservation.getCar().getReservation().get(0);
//		
//	}
	public Car getFirstCar(){
		return currentReservation.getCar();
	}
	
	
	
	@Inject
	@Property
	private Reservations reservations;
	
	
	@Property
	private Reservation currentReservation;
}
